<html>
<body>
<!-- Change password form with username. -->
<form action="done.html" id="chg_testform">
  <input type="text" id="chg_username_field" name="chg_username_field">
  <input type="password" id="chg_password_field" name="chg_password_field">
  <input type="password" id="chg_new_password_1" name="chg_new_password_1">
  <input type="password" id="chg_new_password_2" name="chg_new_password_2">
  <input type="submit" id="chg_submit_button" name="chg_submit_button">
</form>

<button id="chg_clear_button" name="chg_clear_button"
        onclick="document.getElementById('chg_testform').reset()">
  Clear the form on successful JS submission
</button>

<button id="chg_clear_all_fields_button" name="chg_clear_all_fields_button"
        onclick="document.getElementById('chg_password_field').value = '';document.getElementById('chg_new_password_1').value = '';document.getElementById('chg_new_password_2').value = '';">
  Clear all form fields on successful JS submission
</button>

<button id="chg_clear_some_fields_button" name="chg_clear_some_fields_button"
        onclick="document.getElementById('chg_password_field').value = '';document.getElementById('chg_new_password_1').value = '';">
  Clear some form fields
</button>

<!-- Formless change password fields. -->
<input type="password" id="formless_chg_password_field">
<input type="password" id="formless_chg_new_password_1" autocomplete="new-password">
<input type="password" id="formless_chg_new_password_2">

<button id="chg_clear_all_formless_fields_button"
        onclick="document.getElementById('formless_chg_password_field').value = '';document.getElementById('formless_chg_new_password_1').value = '';document.getElementById('formless_chg_new_password_2').value = '';">
  Clear relevant formless fields on successful submission
</button>

<button id="chg_clear_some_formless_fields_button"
        onclick="document.getElementById('formless_chg_password_field').value = '';document.getElementById('formless_chg_new_password_2').value = '';">
  Clear some formless fields
</button>
</body>
</html>
